<%@ include file="/platform/common/header.jsp" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<link type="text/css" href="<common:webRoot/>/resources/platform/workflow/workbench/css/underwaymain.css" rel="stylesheet">
<script type="text/javascript" src="<common:webRoot/>/resources/platform/oldworkflow/workflow-v2.js?v=${sysversion}"></script>
<script type="text/javascript" src="<common:webRoot/>/resources/platform/oldworkflow/generatorHelp.js?v=${sysversion}"></script>
<script type="text/javascript" src="<common:webRoot />/resources/component/layer/layerTool.js?v=${sysversion}"></script>
<style>
	.ng-hide {
		width: 0;
	}

	.read {
		color: #ffffff;
		background-color: #ff7900;
		margin-left: 6px;
		font-size: 10px;
		padding: 4px 4px;
		border-radius: 9px;
	}
</style>
<body ng-init="pageTitle='任务办理台'; LCLXBH='${LCLXBH}'; BZBH='${BZBH}'; pageType='${PAGE_TYPE}';WTYHID='${WTYHID}';WTYHMC='${WTYHMC}';
    pageSize='${PAGE_SIZE}';">
	<!-- 基于 bootstrap 布局 -->
	<div class="container-full" ng-controller="UnderwayMainController" style="height: 100%;overflow: hidden">
		<div class="leftContainMenu">
			<ul class="leftContainMenuUl">
				<div style="margin:8px auto;text-align:center;width:15px;line-height:20px;" ng-if = "showOwn" title="委托人 : {{WTYHMC}}">
					<font color="#FFFFFF">委托人{{WTYHMC  | limitTo : 3}}</font>
				</div>
				<%--<li ng-if = "showEntrustment"><a class="icon-nav-5" ng-mouseover="showLeftList(5)">委托</a></li>
				<li ng-if = "showOwn" title="返回个人办理台"><a class="icon-nav-6" ng-mouseover="showLeftList(6)" ng-click="toOwn()" ng-mouseleave="hideLeftList()">个人</a></li>
				<li><a class="icon-nav-1" ng-mouseover="showLeftList(1)">发起</a></li>--%>
				<li><a class="icon-nav-2 on" ng-mouseover="showLeftList(2)">待办</a><i id="dbTotal" ng-if="underwaysAll">{{ underwaysAll }}</i></li>
				<li><a class="icon-nav-3" ng-mouseover="showLeftList(3)">已办</a><i id="ybTotal" ng-if="processedTasksAll">{{ processedTasksAll }}</i></li>
				<li><a class="icon-nav-4" ng-mouseover="showLeftList(4)">办结</a><i id="bjTotal" ng-if="finishedTasksAll">{{ finishedTasksAll }}</i></li>
			</ul>
		</div>
		<div class="rightContent" style=" ;float: right;position: relative;height: 100%">
			<div ng-show="RightContentType == 2">
				<div class="mask" ng-show="showLeftListContent"></div>
				<div ng-cloak="" ng-show="showDetail">
					<div class="workflowBtn">
						<ul class="workflowBtnUl" id="workflowBtnUl">
							<li class="btnHome" ng-click="refreshdetailUrl($event)">详情</li>
							<li on-finish-render-top-btn ng-repeat="action in actions" ng-click="refreshActionUrl(action.url, action.desc, $event)" li-type="action">
								<span title="已处理" class="icon_finish" ng-if="action.actionFinishedState=='1'" /></span>
								<span title="未处理" class="icon_no" ng-if="action.actionFinishedState=='0'" /></span>
								{{action.desc}}
							</li>

							<li ng-if="actionsHide.length > 0" uib-dropdown is-open="Action.isopen"
								 ng-mouseenter="Action.isopen = true" ng-mouseleave="Action.isopen = false">
								<i class="moreAction"></i>
								<ul class="dropdown-menu">
									<li ng-repeat="action in actionsHide" ng-click="refreshActionUrl(action.url, action.desc, $event)" li-type="action">
										<a>{{action.desc}}</a>
									</li>
								</ul>
							</li>
							<div  class="fr">
								<ul>
									<li id="btnAttention" ng-if="false">
										<span>关注</span>
									</li>
									<li id="btnHistoryList" ng-click="refreshprocessUrl($event)">
										<span>过程</span>
									</li>
									<li id="btnPrint" ng-show="false">
										<span>打印</span>
									</li>
								</ul>
							</div>
						</ul>
					</div>
					<div class="workflowContent" ng-class="{true: 'col-xs-8', false: 'col-xs-12'}[showTransition]" style="position: relative;transition: all linear 0.3s;">
						<iframe id="operateFrame" frameborder="0" marginheight="0" marginwidth="0"
								style="width: 100%;height: 550px;" src="">
						</iframe>
						<iframe id="hiddenOperateFrame" style="display: none;"></iframe>
						<i ng-show="showTransition" ng-click="toggleTransitionClick(false)" class="glyphicon glyphicon-triangle-right" style="position: absolute;right: -14px;top: 40%;color: #C8DBF0;cursor: pointer;font-size: 18px;z-index: 10"></i>
						<i ng-show="!showTransition" ng-click="toggleTransitionClick(true)" class="glyphicon glyphicon-triangle-left" style="position: absolute;right: 0px;top: 40%;color: #C8DBF0;cursor: pointer;font-size: 18px;z-index: 10"></i>
					</div>
					<div class="workflowAction col-xs-4">
						<ul class="operate-tab-hd">
							<li on-finish-render-filters ng-if="canfinish||circulationButton.btnType!='finish'" ng-repeat = "circulationButton in circulationButtons" class="action-li"
								ng-click="changeActionFrame(circulationButton.url,$event,circulationButton.btnType)"><a href="javascript: void(0);">{{circulationButton.desc}}</a></li>
							<li on-finish-render-filters ng-repeat = "sendbackButton in sendbackButtons" class="action-li" ng-click="changeActionFrame(sendbackButton.url,$event)"><a href="javascript: void(0);">{{sendbackButton.desc}}</a></li>
							<li on-finish-render-filters ng-repeat = "finishButton in finishButtons" class="action-li" ng-click="finishFreeflowAction(finishButton.type,$event, finishButton.stepId)"><a href="javascript: void(0);">{{finishButton.desc}}</a></li>
							<li on-finish-render-filters ng-repeat = "otherButton in otherButtons | uniqueBtn: 'type' track by $index"   class="action-li"
								ng-click="changeActionFrame(otherButton.url,$event,otherButton.btnType)"><a href="javascript: void(0);">{{otherButton.desc}}</a></li>

						</ul>
						<div class="operate-tab-bd">
							<iframe id="actionFrame" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"
									style="width: 100%;height: 550px;" src="">
							</iframe>
						</div>
					</div>
				</div>
				<div ng-cloak="" ng-show="!showDetail && !noTaskFlag && !showFree">
					<div class="col-md-3" style="padding: 0">
						<div class="edit-header" style="padding: 0;margin-right: 0">
							<div class="edit-title">
								<i class="iocn"></i>
								<i>批量流转</i>
							</div>
						</div>
						<div class="edit-body" style="padding: 0;margin-right: 0;">

							<div class="col-md-12" style="padding: 0">
								<form>
									<div class="form-group" style="margin-bottom: 0">
										<ui-select ng-model="taskUnderwayWorkflows.selected" on-select="taskChangeSelected($item, $model)">
											<ui-select-match>
												<span ng-bind="$select.selected.label"></span>
											</ui-select-match>
											<ui-select-choices repeat="item in (taskUnderwayWorkflows | filter: $select.search) track by item.value">
												<span ng-bind="item.label"></span>
											</ui-select-choices>
										</ui-select>
									</div>
								</form>
							</div>

							<div class="col-md-12" style="padding: 0">
								<ul class="ul-content taskCountList">
									<li class="li-content li-font" title="点击查看所有任务" ng-click="taskQueryByStatus('',$event)">总数：<span class="">{{taskTotalCount}}</span></li>
									<li class="li-content" title="本步骤和本流程都未超时" ng-click="taskQueryByStatus('ZC',$event)">正常：<span class="li-number">{{taskNormalCount}}</span></li>
									<li class="li-content" title="本步骤已超时，本流程未超时" ng-click="taskQueryByStatus('CS',$event)">超时：<span class="li-number">{{taskOvertimeCount}}</span></li>
									<li class="li-content" title="本步骤和本流程都已超时" ng-click="taskQueryByStatus('BJ',$event)">报警：<span class="li-number">{{taskWarningCount}}</span></li>
								</ul>
							</div>

							<div class="col-md-12" style="padding: 0" id="massTab">
								<div ng-if="taskUnderways.length">
									<table ng-repeat = "taskUnderway in taskUnderways" class="col-md-12 taskUnderway">
										<thead>
										<tr class="workflow-title">
											<th colspan="4">
												<input style="margin-right: 5px" type="checkbox" ng-click="checkBatchStep($event, taskUnderway.BZDYBH)" class="{{taskUnderway.BZDYBH}}">
												<span>{{taskUnderway.BZMC }}</span>
											</th>
										</tr>
										</thead>
										<tbody>
										<tr ng-repeat = "takeRow in taskUnderway.takeRows" class="tr-takeRow underwayList tr-row">
											<td style="width:30px;text-align: center">
												<input type="checkbox"  ng-click="checkStep(takeRow.BZDYBH, $event)" class="{{takeRow.BZDYBH}}" bzdybh = "{{takeRow.BZDYBH}}" rwmc = "{{takeRow.RWMC}}" bzbh = "{{takeRow.BZBH}}">
												<!-- <input class="magic-checkbox" type="checkbox" name="{{takeRow.BZBH}}" id="{{takeRow.BZBH}}"> -->
												<!-- <label class="control-label" for="{{takeRow.BZBH}}"></label> -->
											</td>
											<td style="width: 25px;text-align: center">
												<span style="margin-left: 5px" class="{{takeRow.REMAIN | lcbjClass}}" title="{{takeRow.REMAIN | lcbjTitle:takeRow.RWQX}}">&nbsp;</span>
												<span style="margin-left: 5px" class="{{takeRow.STEPREMAIN_HOUR | bzbjClass:takeRow.STEPREMAIN}}" title="{{takeRow.STEPREMAIN_HOUR | bzbjTitle:takeRow.STEPREMAIN:takeRow.BZQX_MINUTE:takeRow.BZQX}}">&nbsp;</span>
											</td>
											<td title="点击查看{{takeRow.RWMC}}详情" ng-click = "showContent(takeRow.LCBH, takeRow.LCSLBH, takeRow.BZDYBH, takeRow.BZBH, takeRow.RWBH)">
												<p class="line-one">{{takeRow.RWMC}}</p>
												<p class="line-two">
													<span class="timeSpan"><i ng-if="takeRow.BZQX" class="glyphicon glyphicon-time" style="margin-right: 2px"></i><span>{{takeRow.BZQX}}</span></span>
												</p>
											</td>
											<td style="width: 45px;text-align: center;padding-left: 13px">
												<span class="{{takeRow.WWCDZ | undoClass:takeRow.WWCFJ}}" title="{{takeRow.WWCDZ | undoTip:takeRow.WWCFJ}}" ></span>
											</td>
										</tr>
										<tr ng-if="!taskUnderway.takeRows.length">
											<td class="no-data">此目录下暂无待办任务</td>
										</tr>
										</tbody>
									</table>
								</div>
								<p class="no-data" ng-if="!taskUnderways.length">暂无待办任务</p>

							</div>

						</div>
					</div>
					<div class="col-md-9" style="padding: 0;border-left: 1px solid #e8e8e8;margin: 0">
						<div class="edit-header">
							<div class="col-md-9 edit-title">
								<i class="iocn"></i>
								<i title="只支持唯一主办的任务批量流转，并行和传阅的任务不显示"><span style="font-size: 12px">温馨提示：只支持唯一主办的任务批量流转，并行和传阅的任务不显示</span></i>
							</div>
							<div class="col-md-3 edit-btn-box" ng-show = "showCloseDetail" style="padding-left: 0">
								<button id="role_save" type="button" class="btn btn-default close-btn btn-sm" ng-click="closeDetail()">关闭详情</button>
							</div>
						</div>
						<div class="edit-body" style="margin: 0">
							<div class="batchCirculationTips-no" ng-show = "showTip">从左边选择需要批量流转的任务！</div>
							<div ng-show = "showCirculation">
								<iframe id="circulationFrame" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"
										style="width: 100%;height: 500px;" src="">
								</iframe>
							</div>
							<div ng-show = "showChecked">
								<div class="batchCirculationTips">
									已选中<span style="color:#ff0000;">({{checkedNum}})</span>条任务
									<span title = "taskName">{{taskName}}</span>
								</div>
								<iframe id="checkedFrame" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"
										style="width: 100%;height: 500px;" src="">
								</iframe>
							</div>
						</div>
					</div>
				</div>
				<div ng-cloak="" ng-show="!showDetail && !noTaskFlag && showFree">
					<iframe id="freeflowFrame" frameborder="0" scrolling="no" marginheight="0" marginwidth="0"
							style="width: 100%;height: 500px;" src="">
					</iframe>
				</div>
			</div>
			<div ng-show="RightContentType == 1">
				<iframe class="iframe" id="FQ-frame" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="">
				</iframe>
			</div>
			<div ng-show="RightContentType == 3 || RightContentType == 4">
				<iframe class="iframe" id="YB-frame" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="">
				</iframe>
			</div>
			<div ng-show="!showDetail && noTaskFlag">
                <iframe id="noTasksFrame" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" style="width: 100%;" src="">
                </iframe>
            </div>
		</div>
		<div class="leftListContent" ng-show="showLeftListContent"   ng-mouseleave="hideLeftList(this)">
			<div class="DB-list" ng-show="DB_list">
				<div class="edit-header">
					<div class="edit-title list-menu-title">
						<i class="list-icon"></i>
						<i>待办任务</i>
					</div>
				</div>
				<div class="list-body" style="margin-right: 0">
					<div class="col-md-12" style="padding: 0">
						<form>
							<div class="form-group searchContent" style="margin-bottom: 0">
                                <input type="text" class="searchInput" placeholder="按任务名称查找" ng-model="rwmcFilterValue" style="float: left"/>
                                <span class="glyphicon glyphicon-search platform-search-icon" ></span>
                            </div>
							<div class="form-group" style="margin-bottom: 0">
								<ui-select ng-model="underwayWorkflows.selected" on-select="changeSelected($item, $model)">
									<ui-select-match>
										<span ng-bind="$select.selected.label"></span>
									</ui-select-match>
									<ui-select-choices repeat="item in (underwayWorkflows | filter: $select.search) track by item.value">
										<span ng-bind="item.label"></span>
									</ui-select-choices>
								</ui-select>
							</div>
						</form>
					</div>

					<div class="col-md-12" style="padding: 0">
						<ul class="ul-content countList">
							<li class="li-content li-font" title="点击查看所有任务" ng-click="queryByStatus('',$event)">总数：<span class="">{{count.totalCount}}</span></li>
							<li class="li-content" title="本步骤和本流程都未超时" ng-click="queryByStatus('ZC',$event)">正常：<span class="li-number">{{count.normalCount}}</span></li>
							<li class="li-content" title="本步骤已超时，本流程未超时" ng-click="queryByStatus('CS',$event)">超时：<span class="li-number">{{count.overtimeCount}}</span></li>
							<li class="li-content" title="本步骤和本流程都已超时" ng-click="queryByStatus('BJ',$event)">报警：<span class="li-number">{{count.warningCount}}</span></li>
						</ul>
					</div>

					<div class="col-md-12" ng-show="showUnderway" style="padding: 0">
						<div ng-if="underways.length" class="tableContainer">

							<table ng-repeat = "underway in underways track by $index" class="col-md-12">
								<thead>
								<tr class="workflow-title" ng-click="openOrClose($index,$event)">
									<th colspan="2">
										<span title="{{underway.LCMC}}({{underway.rows.length}}/{{underway.total}})" class="title-left"><span class="icon">{{underway.LCMC}}({{underway.rows.length}}/{{underway.total}})</span></span>
										<span class="glyphicon glyphicon-share" title="批量流转{{underway.LCMC}}" class="title-right" ng-click="gotoBatchTransition(underway.LCLXBH, underway.flowType, $event)"></span>
										<span class="glyphicon glyphicon-menu-down"  id="{{'open'+$index}}" title="收起/展开"  class="title-right"></span>
									</th>
								</tr>
								</thead>
								<tbody class="underwayList" id="{{'tbody'+$index}}" style="display: none;">
								<tr id="{{row.BZBH}}" ng-repeat = "row in underway.rows track by $index" class="tr-row" ng-click = "selectWorkflow(row.BZBH,$event,this)">
									<td style="width: 45px;text-align: center">
										<i class="{{row.REMAIN | lcbjClass}}" title="{{row.REMAIN | lcbjTitle:row.RWQX}}"></i>
										<i class="{{row.STEPREMAIN_HOUR | bzbjClass:row.STEPREMAIN}}" title="{{row.STEPREMAIN_HOUR | bzbjTitle:row.STEPREMAIN:row.BZQX_MINUTE:row.BZQX}}"></i>
									</td>
									<td>
										<p class="line-one">{{row.RWMC}}<span ng-if="row.SFYD!=1" class="read">未读</span></p>
										<p class="line-two">
											<span class="stepSpan"><i ng-if="false" class="glyphicon glyphicon-th-list" style="margin-right: 2px"></i><span>{{row.BZMC}}</span></span>
											<span class="timeSpan"><i ng-if="row.BZQX" class="glyphicon glyphicon-time" style="margin-right: 2px"></i><span>{{row.BZQX}}</span></span>
										</p>
									</td>
								</tr>
								<tr ng-if="!underway.rows.length">
									<td class="no-data">此目录下暂无待办任务</td>
								</tr>
								</tbody>
							</table>
						</div>

						<p class="no-data" ng-if="!underways.length">暂无待办任务</p>
					</div>
				</div>
			</div>
			<div class="WT-list" ng-show="WT_list">
				<div class="edit-header">
					<div class="edit-title list-menu-title">
						<i class="list-icon"></i>
						<i>委托用户</i>
					</div>
				</div>
				<div  class="edit-body" style="margin-right: 0">
					<div class="searchDetail" ng-if="entrustments.length">
						<div class="list-group" style="margin-bottom: 0;position: relative">
							<a ng-repeat="item in entrustments" ng-click="toEntrustment(item)" data="{{item}}" class="list-group-item">
								<span id="{{item.WTYHID}}" data="{{item}}">{{item.WTYHMC}} ({{item.WTKSSJ | date:'yyyy-MM-dd'}} 至 {{item.WTJSSJ | date:'yyyy-MM-dd'}})</span>
							</a>
						</div>
					</div>
					<div ng-if="!entrustments.length" class="no-data-mark">
						暂无委托用户
					</div>
				</div>
			</div>
			<div class="FQ-list" ng-show="FQ_list">
				<div class="edit-header">
					<div class="edit-title list-menu-title">
						<i class="list-icon"></i>
						<i>发起任务</i>
					</div>
				</div>
				<div  class="edit-body" style="margin-right: 0">
					<div class="searchDetail" ng-if="startWorkflows.length">
						<div class="list-group" style="margin-bottom: 0;position: relative">
							<a ng-repeat="item in startWorkflows" ng-click="changeUrl('1', $event)" data="{{item}}" class="list-group-item">
								<span id="{{item.LCBH}}" data="{{item}}">{{item.LCMC}}</span>
							</a>
						</div>
					</div>
					<div ng-if="!startWorkflows.length" class="no-data-mark">
						暂无可发起的任务
					</div>
				</div>
			</div>
			<div class="YB-list" ng-show="YB_list">
				<div class="edit-header list-menu-title">
					<div class="edit-title">
						<i class="list-icon"></i>
						<i>已办任务</i>
					</div>
				</div>
				<div class="edit-body" style="margin-right: 0">
					<div  class="searchDetail" ng-if="processedTasks.length">
						<div class="list-group">
							<a ng-repeat="item in processedTasks" ng-click="toWorkflowsHistory(item.LCLXBH, item.flowType, 'processed')" class="list-group-item">
								<span>{{item.LCMC}}(<i class="li-num">{{item.SL}}</i>)</span>
							</a>
						</div>
					</div>
					<div ng-if="!processedTasks.length" class="no-data-mark">
						暂无已办数据
					</div>
				</div>
			</div>
			<div class="BJ-list" ng-show="BJ_list">
                <div class="edit-header list-menu-title">
                    <div class="edit-title">
                        <i class="list-icon"></i>
                        <i>办结任务</i>
                    </div>
                </div>
                <div class="edit-body" style="margin-right: 0">
                    <div  class="searchDetail" ng-if="finishedTasks.length">
                        <div class="list-group">
                            <a ng-repeat="item in finishedTasks" ng-click="toWorkflowsHistory(item.LCLXBH, item.flowType, 'finished')" class="list-group-item">
                                <span>{{item.LCMC}}(<i class="li-num">{{item.SL}}</i>)</span>
                            </a>
                        </div>
                    </div>
                    <div ng-if="!finishedTasks.length" class="no-data-mark">暂无办结数据</div>
                </div>
            </div>
		</div>
		<button id="refreshPage" ng-show="false" ng-click="refreshPage($event)">refresh</button>
	</div>
	<script type="text/javascript" src="<common:webRoot/>/resources/platform/common/js/workflow.js?v=${sysversion}"></script>
	<script type="text/javascript" src="<common:webRoot/>/resources/platform/common/js/freeflow.js?v=${sysversion}"></script>
	<script type="text/javascript" src="<common:webRoot />/resources/platform/workflow/workbench/underwaymainv4.js?v=${sysversion}"></script>
</body>
<%@include file="/platform/common/footer.jsp" %>